angular.module('error.utils',[])
	.factory('ErrorUtils',function(){
		
		var errorObj = {
						'1000':'Email already exists.',
						'1001':'Blank field not allowed',
						'1002':'Employee not found',
						'1003':'Invalid credentials',
						'1004':'Internal server error',
						'1005':'Invalid business object type',
						'1006':'Missing annotation'
					};
		
		var service = {
				getMessageByErrorCode:function(code){
					try{
						return errorObj[code];
					}
					catch(err){
						return err.message;
					}
				}
				
		};
		
		return service;
	});